<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
 session_start();


 include("../main/function.php");
 include("../main/ShowPage.class.php");

 $db=new Db();
 
 //ajax判断 数据合法性
 function outputsetmsg($msg)
 {
 	/*echo "<script>document.getElementByid('submitmsg').value='".$msg."';</script>";*/
	if("0"==$msg){
		echo "<img src='../images/wrong.jpg' width='16' />";	
		exit();
	}else{
		echo "<img src='../images/right.jpg' width='16' />";	
		exit();	
	}
 }
 
 $username=$_GET['username'];
 $password=$_GET['password'];
 $idcard=$_GET['idcard'];
 if($username=='' || $password=='' || $idcard==''){
 	echo "请检测填写的信息是否正确 ";
 	outputsetmsg(0);
 }
 $password=md5($password);
 /*echo "<script>alert('$id');</script>";*/
 
 $state=$db->query("INSERT INTO `teacher_user` (`id`, `username`, `password`, `idcard`, `state`) VALUES (NULL, '$username', '$password', '$idcard', '1');");
 //echo "select * from area where fid='$id' order by id";
 if($state){
 	exit("<span style='color:#FF0000'>注册成功！</span>");
 }else{
 	exit("<span style='color:#FF0000'>注册失败，请重试！</span>");
 }
 
?>










